package com.shop.local;

import com.shop.dto.PageInfo;

/**
 * @author wzby
 * @Date: 2022/10/17 20:56
 */

public class PageInfoLocal {
    private static ThreadLocal<PageInfo>  pageInfoThreadLocal = new InheritableThreadLocal<>();

    //给当前线程上贴一个变量 pageinfo
    public static void set(PageInfo pageInfo){
        pageInfoThreadLocal.set(pageInfo);
    }

    //获取当前线程脑门上的变量 pageinfo
    public static PageInfo get(){
        return pageInfoThreadLocal.get();
    }

    //移除当前线程脑门上的便令 pageinfo
    public static void clean(){
        pageInfoThreadLocal.remove();
    }

}
